package com.ttmusic.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 
 * @author wuchangyong
 *
 */
public class ThreadFactroy {

    private static ThreadFactroy mInstance = new ThreadFactroy();

    private ExecutorService mMusicOperateExecutor;

    private ThreadFactroy() {

    }

    public static ThreadFactroy get() {
        return mInstance;
    }

    public ExecutorService getMusicOperateExecutor() {
        if (mMusicOperateExecutor == null) {
//        	mMusicOperateExecutor.shutdown();
//        	mMusicOperateExecutor.shutdownNow();
//        	mMusicOperateExecutor = null;
        	mMusicOperateExecutor = Executors.newSingleThreadExecutor();
        }
        
        return mMusicOperateExecutor;
    }
}
